<template>
  <!-- 弹出框园区党组织架构 -->
  <div class="partyC">
    <div class="partyC_title">
      <span>园区党组织架构</span>
    </div>
    <div class="partyC_rowC">
      <div class="partyC_rowC_type">
        <span v-for="item in type1List" :key="item">{{ item }}</span>
      </div>
      <div class="partyC_xline"></div>
      <div style="display: flex;flex-direction: column">
        <div style="display: flex;flex-direction: row;align-items: center"
             v-for="(item,index) in partyData.children" :key="item">
          <div style="display: flex;flex-direction: column">
            <div class="partyC_yline" :style="index == 0 ?'  opacity:0':''"></div>
            <div class="partyC_yline" :style="index == partyData.children.length-1 ?'  opacity:0':''"></div>
          </div>
          <div class="partyC_xline"></div>
          <div class="partyC_rowC_type2" @click="changePos(index)">
            <span>{{ item.title }}</span>
            <div class="partyC_rowC_type2_icon" :style="index == selectPos ?'opacity:1':'opacity:0'"></div>
          </div>
          <div style="display: flex;flex-direction: column;height: 100%" v-show="index == selectPos">
            <div class="partyC_rowC_type3" v-for="(cItem,cIndex) in item.children" :key="cItem">
              <div style="display: flex;flex-direction: column">
                <div class="partyC_rowC_type3_yline" :style="cIndex == 0 ?'  opacity:0':''"></div>
                <div class="partyC_rowC_type3_yline" :style="cIndex == item.children.length-1 ?'  opacity:0':''"></div>
              </div>
              <div class="partyC_rowC_type3_xline"></div>
              <span>{{ cItem.title }}</span>
            </div>
          </div>
        </div>

      </div>
    </div>
    <div class="partyC_close" @click="closeParty"></div>
  </div>
</template>

<script>

// 园区党组织架构详情弹窗

export default {
  name: "partyDialog",
  props: {
    partyData: Object,//架构数据
  },
  mounted() {
    if (this.partyData) {
      this.type1List = this.dealData.split(this.partyData.title, '')
    }
  },
  data() {
    return {
      selectPos: -1,//默认点击的位置
      type1List: ''
    }
  },
  methods: {
    closeParty() {
      this.$emit('partyDialogImp')
    },
    //选中位置
    changePos(index) {
      this.selectPos = index
    }
  }
}
</script>

<style lang="scss">
.userFlex {
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */
  overflow-y: auto;
}

.userFlex::-webkit-scrollbar {
  display: none; /* Chrome Safari */
}

.partyC {
  width: 662px;
  height: 400px;
  display: flex;
  position: relative;
  background-size: 100% 100%;
  background-image: url("@/assets/news/bg_news.png");
  flex-direction: column;

  &_close {
    position: absolute;
    right: 20px;
    cursor: pointer;
    top: 30px;
    width: 23px;
    height: 22px;
    background-size: 100% 100%;
    background-image: url("@/assets/news/icon_closenews.png");
  }

  &_title {
    margin-left: 22px;
    width: 216px;
    height: 24px;
    margin-top: 30px;
    display: flex;
    flex-direction: row;
    align-items: center;
    background-size: 100% 100%;
    background-image: url("@/assets/bg_title1.png");

    span {
      height: 24px;
      font-size: 13px;
      font-family: Source Han Sans SC;
      font-weight: bold;
      color: #FFFFFF;
      margin-left: 11px;
      line-height: 24px;
      background: linear-gradient(0deg, #90CCFF 0%, #FAFAFB 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  &_rowC {
    display: flex;
    align-items: center;
    flex-direction: row;
    height: 300px;

    &_type {
      margin-left: 43px;
      width: 17px;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;

      span {
        font-size: 18px;
        font-family: PingFang SC;
        font-weight: bold;
        color: #FFFFFF;
      }
    }

    &_type2 {
      display: flex;
      width: 190px;
      padding-left: 5px;
      align-items: center;
      flex-direction: row;
      align-items: center;
      height: 35px;
      cursor: pointer;
      background-size: 100% 100%;
      position: relative;
      background-image: url("@/assets/news/word_bgc.png");

      span {
        width: 145px;
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: bold;
        color: #FFFFFF;
      }

      &_icon {
        width: 9px;
        right: 13px;
        height: 12px;
        background-size: 100% 100%;
        position: absolute;
        background-image: url("@/assets/news/icon_23.png");
      }
    }

    &_type3 {
      margin-left: 5px;
      display: flex;
      flex-direction: row;
      align-items: center;

      span {
        height: 14px;
        font-size: 12px;
        margin-left: 3px;
        line-height: 14px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #FFFFFF;
      }

      &_xline {
        width: 30px;
        height: 1px;
        background-color: #ffffff;
      }

      &_yline {
        width: 1px;
        height: 7px;
        background-color: #ffffff;
      }
    }
  }

  &_xline {
    width: 50px;
    height: 1px;
    background-color: #ffffff;
  }

  &_yline {
    width: 1px;
    height: 60px;
    background-color: #ffffff;
  }
}

@media screen and (min-width: 1000px) and (max-width: 3000px) {
  $width_2k: 1920;
  $height_2k: 1080;
  $width: 4000;
  $height: 1486;
  $unit: px;
  @function calWidth_2k($pixel) {
    @return $width_2k*$pixel/$width;
  }
  @function calHeight_2k($pixel) {
    @return $pixel/1.8*2.7;
  }
  @function calFont_2k($pixel) {
    @return $height_2k*$pixel/$height;
  }
  .userFlex {
  }

  .userFlex::-webkit-scrollbar {
  }

  .partyC {
    height: calHeight_2k(400px);

    &_close {
      top: calHeight_2k(30px);
      width: calHeight_2k(23px);
      height: calHeight_2k(22px);
    }

    &_title {
      height: calHeight_2k(24px);
      margin-top: calHeight_2k(30px);

      span {
        height: calHeight_2k(24px);
        line-height: calHeight_2k(24px);
      }
    }

    &_rowC {
      height: calHeight_2k(300px);

      &_type {

        span {
        }
      }

      &_type2 {
        height: calHeight_2k(35px);

        span {
        }

        &_icon {
          height: calHeight_2k(12px);
        }
      }

      &_type3 {

        span {
          height: calHeight_2k(14px);
          line-height: calHeight_2k(14px);
        }

        &_xline {
        }

        &_yline {
          height: calHeight_2k(7px);
        }
      }
    }

    &_xline {
      height: calHeight_2k(1px);
    }

    &_yline {
      height: calHeight_2k(60px);
    }
  }
}
</style>